<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  <input type="button" value="按钮1" @click="f()">
  <input type="button" value="按钮2" v-on:click="f()">
</div>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"></script>
<script>
  let v = new Vue({
    el:"div",
    data:{},
    methods:{
      f:function () {
        alert("方法执行了!")
      }
    }
  })
</script>
</body>
</html>